home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / asmsrc / tango2.lha / SOURCES / 1PIXSINE22223333344441.S < prev    next >
Encoding:
Text File  |  1988-07-19  |  19.0 KB  |  971 lines

  1. ;    ** RAY SEE IF KODAK CAN MAKE THIS ANY BETTER **
  2. ; ** 2 PIXEL ACCURACY SINE WAVE BY TANGO OF CRYPTIC **
  3. ;     ** ONLY SPREAD SOURCE TO CRYPTIC MEMBERS **
  4.  
  5.     opt c-
  6.     section blitter,code_c            Chip Ram please !!
  7.     include    df1:definitions            Give me some hardware reggies
  8.     include    df1:macros                Give me some macros
  9.     
  10.         
  11. ;LOCAL CONSTANTS
  12.  
  13. icra        equ $bfed01                
  14. allocmem     =-30-168                
  15. freemem     =-30-180                
  16.  
  17. TAKEOVER:
  18.  
  19. ; KILL SYSTEM COPPER, KEYBOARD ETC.....
  20.  
  21.     LEA custom,a5        
  22.     LEA GFXLIB(PC),a1             Point to 'graphics.library'
  23.     MOVEQ #0,D0                     Doesn't matter which version
  24.      MOVE.L 4.w,a6                 EXECBASE
  25.     jsr    -132(a6)                 task switching off (forbid)
  26.      JSR -$228(a6)                  Openlibrary
  27.      MOVE.L D0,GFXBASE             Store library address
  28.     jsr    cryptic_init
  29.     
  30.         
  31. ;Now put the graphic addresses in the CopperList         
  32.  
  33.  
  34.      move.l    #sprite,d1            
  35.      move.w    d1,sp0lo+2
  36.      swap    d1
  37.      move.w    d1,sp0hi+2
  38.  
  39.  
  40.      move.l GFXBASE,d0            Move gfxbase offset to d0
  41.      MOVE.L D0,A6                
  42.      MOVE.W #$80,dmacon(a5)        Turn off copper whilst changing it
  43.      MOVE.L $32(A6),WBCOPPER         Store old (WBench) copper address
  44.      MOVE.L #OURCOPPER,$32(A6)    Point to new copper list (our own)
  45.      MOVE.W #$8080,dmacon(a5)    re-enable copper
  46.  
  47.      MOVE.W #$8010,intena(a5)        
  48.      MOVE.L $6c,old                Save work bench interrupt
  49.      MOVE.L #LEV3,$6c            This sets up a level 3 interrupt
  50.     move.w    intenar(a5),systemints
  51.     move.b    #%01111111,icra        Kill keyboard
  52.         
  53. WAIT:     
  54.     BTST #6,$BFE001                This waits for the left
  55.      BNE.S    WAIT                mouse button to be pressed
  56.     move.l    4.w,a6                EXECBASE
  57.      MOVE.L old,$6c                Restore system interrupts
  58.     MOVE.L GFXBASE,A6
  59.      MOVE.W #$80,dmacon(a5)        Disable DMA
  60.      MOVE.L WBCOPPER,$32(A6)        Restore old copperlist
  61.      MOVE.W #$8080,dmacon(a5)    Enable DMA
  62.      move.w    systemints,d0        Systems interrupt
  63.      or.w    #$c000,d0
  64.      move.w    d0,intena(a5)        Enable OS interrupts
  65.      move.b    #%10011011,icra        Enable keyboard
  66.     clr.w    $dff0a8                Clear music
  67.     clr.w    $dff0b8
  68.     clr.w    $dff0c8
  69.     clr.w    $dff0d8
  70.     move.w    #$f,$dff096
  71.     CLR.L    D0
  72.     rts
  73.  
  74.  
  75. ERROR:    
  76.     move.l 4.w,a6                Get EXECBASE
  77.     jsr    -138(a6)                Permit ( multi-tasking on )
  78.     moveq    #0,d0                Clear d0
  79.      RTS                            Return to AmigaDOS
  80.  
  81.  
  82. ;This is the NEW level 3 interrupt
  83.  
  84. LEV3:
  85.      MOVEM.L d0-d7/a0-a6,-(sp)    Save all registers to the stack
  86.     lea    custom,a5
  87.     AND #$10,intreqr(a5)           Check if interrupt is from Copper 
  88.     BNE out
  89.     move.w    #$8010,$9c                                
  90.     
  91.  
  92. ; ** ALL ROUTINES CALLED (HOPEFULLY) EVERY VBI **
  93.  
  94.     MOVE.W #$FFF,$DFF180
  95.     bsr    try_sin
  96.     bsr    testscroll
  97.  
  98.      bsr    cryptic_music
  99.      move.l    sin_screen,d1        Bitplane memory address
  100.     move.w    d1,bp1lo+2            Used for double buffering
  101.      swap    d1
  102.      move.w    d1,bp1hi+2
  103.  
  104.     bsr        move_stars
  105.     MOVE.W #$000,$DFF180
  106.     
  107.     
  108. out:     
  109.     MOVEM.L (sp)+,d0-d7/a0-a6    Restore the registers
  110.     DC.W $4ef9                    hex value for  JMP instruction
  111. old:     
  112.     DC.L 0                        will jump to normal interrupt
  113.  
  114.  
  115. ; ** Move the sprites **
  116.  
  117. move_stars:
  118.  
  119.     sub.b    #$1,x+1
  120.     sub.b    #$2,x+9
  121.     sub.b    #$1,x+17
  122.     sub.b    #$3,x+25
  123.     sub.b    #$2,x+33
  124.     sub.b    #$4,x+41
  125.     sub.b    #$2,x+49
  126.     sub.b    #$1,x+57
  127.     sub.b    #$3,x+65
  128.     sub.b    #$1,x+73
  129.     sub.b    #$2,x+81
  130.     sub.b    #$4,x+89
  131.     sub.b    #$3,x+97
  132.     sub.b    #$2,x+105
  133.     sub.b    #$1,x+113
  134.     sub.b    #$4,x+121
  135.     sub.b    #$3,x+129
  136.     sub.b    #$3,x+137
  137.     sub.b    #$2,x+145
  138.     sub.b    #$4,x+153
  139.     sub.b    #$1,x+161
  140.     sub.b    #$3,x+169
  141.     sub.b    #$1,x+177
  142.     sub.b    #$2,x+185
  143.     sub.b    #$4,x+193
  144.     sub.b    #$1,x+201
  145.     sub.b    #$3,x+209
  146.     sub.b    #$1,x+217
  147.     sub.b    #$2,x+225
  148.     sub.b    #$2,x+233
  149.     rts
  150.  
  151.  
  152. ; ** Double Buffer The Screen **
  153.  
  154. Buff:
  155.     Eor.l    #10240,Tango                ; Next screen is 10240 bytes along
  156.     Move.l    Tango,D1
  157.     Move.l    #SinePlane,d2
  158.     Add.l    D1,d2
  159.     Move.l    D2,Sin_Screen
  160.     Rts
  161.  
  162.  
  163. ; ** THE SCROLL ROUTINE **
  164.  
  165. testscroll:
  166.     tst.l    stopper
  167.     beq.s    scroll
  168.     sub.l    #1,stopper
  169.     rts
  170. scroll:
  171.     cmp.l    #15*4,val                Blitshifted all <<<
  172.     blo.s    coarse_scroll_it        No then get doing it !!
  173.     bsr        blit_char                Blit letter to screen
  174.     clr.l    val                        Reset index
  175. coarse_scroll_it:
  176.     bsr        coarse                    Scroll all line
  177.     rts                            
  178.     
  179.     
  180. ; ** BLIT LETTER ON THE SCREEN **
  181.  
  182. blit_char
  183.     jsr        text
  184.     lea        custom,a5                Get custom chip address
  185.     move.l    screenx,a0                 Can~t see this picture !!
  186.     move.l    #font,a1                 Put font in blitter source
  187.     add.l    d1,a1
  188. blit_test:
  189.     btst    #14,$dff002                 Blitter busy !!!
  190.     bne    blit_test                     Lets wait till she finishes !
  191.     move.w    #$ffff,bltafwm(a5)        
  192.     move.w    #$ffff,bltalwm(a5)        
  193.     move.l    a0,bltdpth(a5)             Blitter dest D (BOTTOM OF SCREEN)
  194.     move.l    a1,bltapth(a5)             Blitter source A (SCROLLING FONT)
  195.     move.w    #38,bltamod(a5)             Modulo (20-1)*2
  196.     move.w    #38,bltdmod(a5)             Modulo (20-1)*2
  197.     move.w    #$9f0,bltcon0(a5)         Minterms D=A
  198.     clr.w    bltcon1(a5)                 Set Ascending mode
  199.      move.w    #16*64+1,bltsize(a5)     Blit size (SIZE OF FONT)
  200.     rts                                  Return
  201.  
  202.  
  203. ; ** BLITSHIFT THE ENTIRE SCROLL LINE **
  204.  
  205. coarse:
  206.     lea        custom,a5                 
  207.     move.l    screenx,a0                ; Can~t see this picture !!
  208.     move.l    a0,a1
  209.     add.l    #2,a1
  210. blit_wait:
  211.     btst    #14,$dff002            
  212.     bne        blit_wait
  213.     incl    #4,val                    ; (1 for slower)
  214.     move    #15,d7                    ; Amount of pixels to shift(15 for slow)
  215.     ror        #4,d7                    ; Set to correct bits (12-15)
  216.     or        #%100111110000,d7        
  217.     move.l    #-1,bltafwm(a5)
  218.     move.l    a1,bltapth(a5)
  219.     move.l    a0,bltdpth(a5)
  220.     move.w    #0,bltamod(a5)
  221.     move.w    #0,bltdmod(a5)
  222.     move.w    d7,bltcon0(a5)    
  223.     move.w    #80*64+20,bltsize(a5)
  224.     rts    
  225.  
  226.  
  227. ; ** BLITTER CLEAR WHERE THE SINE SCROLL HAS JUST BEEN **
  228.  
  229. CLEAR:
  230.     Move.l    Sin_Screen,a0
  231. wate
  232.     btst    #14,$dff002
  233.     bne.s    wate
  234.     Move.l    a0,Bltdpth(a5)
  235.     Move    #0,Bltdmod(a5)
  236.     Move.l    #$1f00000,Bltcon0(a5)
  237.     Move    #133*64+20,Bltsize(a5)
  238.     Rts
  239.  
  240.  
  241. ; ** DO THE SINEWAVE **
  242. ; BLITTER HAS TO COPY EVERY 2 PIXELS ACROSS, THATS ALOT OF WORK !!!
  243.  
  244. try_sin:
  245.     Bsr        buff
  246.     bsr        clear
  247.     Move.l    Table1,A3
  248.     Move.w    (A3),d1
  249.     Cmp.w    #$ffff,d1
  250.     Bne        ItsOkYa
  251.     Move.l    #SinTab,A3
  252. ItsOkYa
  253.     Add.l    hi_amplitude,A3
  254.     Move.l    a3,Table1
  255.     Move.l    A3,Table
  256.     lea        custom,a5                 
  257.     MOVE.W    #$DFC,D2                ; D=A+B
  258.     LEA        BLTAFWM(A5),A2            ; FWM           IN A2
  259.     LEA     BLTSIZE(A5),A4            ; BLITSIZE        IN A4
  260.     LEA        BLTAPTH(A5),A6
  261.     MOVE.W    #16*64+1,D7                ;                IN D3
  262.     move.l    screenx,a0                 ; Source A
  263.     move.l    #18,d4                    ; Number of chars along screen
  264.     clr.l    d5
  265.     clr.l    d6
  266. ban:
  267.     MOVE.W    #%1000000000000000,d3    ; PUT TO 1 FOR ONE PIXEL 
  268. blit_test0:      
  269.     BSR        BLIT_WAITMAN
  270.     move.w    D2,bltcon0(a5)         
  271.     clr.w    bltcon1(a5)                 
  272.     move.w    #38,bltamod(a5)             
  273.     move.w    #38,bltdmod(a5)             
  274.     move.w    #38,bltbmod(a5)             
  275.      REPT    16
  276.     move.l    sin_screen,a1
  277.     bsr        get_sinvalue
  278.     move.w    d3,(A2)                    ; FWM MASK
  279.     move.l    a1,bltdpth(a5)             
  280.     move.l    a1,bltbpth(a5)             
  281.     move.l    a0,(A6)
  282.     MOVE.W    D7,(A4)                    ; BLITSIZE
  283.     LSR        #1,D3
  284.     ENDR
  285.     add.l    #2,a0                    ; Get next letter along
  286.     add.l    #2,d6
  287.     dbf        d4,ban
  288.     rts                                  
  289.  
  290.  
  291.  
  292. BLIT_WAITMAN:
  293.     BTST    #14,$DFF002
  294.     BNE.S    BLIT_WAITMAN
  295.     RTS
  296.     
  297.     
  298. get_sinvalue:
  299.     Clr.l    D5
  300.     Move.l    Table,A3
  301.     Move.w    (A3),d5
  302.     cmp.w    #$ffff,d5
  303.     bne        cryptic90
  304.     Move.l    #SinTab,A3
  305.     Move.w    (a3),d5
  306. cryptic90
  307.     Add.l    lo_amplitude,A3
  308.     Move.l    A3,Table
  309.     add.l    d5,a1
  310.     Add.l    D6,A1
  311.     rts
  312. Table1:    Dc.l    SinTab    
  313. table:    dc.l    sintab
  314.  
  315.  Even
  316. ; ** RAY SEE IF YOU CAN GET A BETTER SINUS TABLE FOR FULL SCREEN !!! **
  317. sintab:
  318.     dc.w $3C*40,$3F*40,$42*40,$46*40,$49*40,$4C*40,$50*40,$53*40,$56*40,$59*40
  319.     dc.w $5C*40,$5F*40,$61*40,$64*40,$67*40,$69*40,$6B*40,$6D*40,$6F*40,$71*40
  320.     dc.w $72*40,$73*40,$75*40,$76*40,$76*40,$77*40,$77*40,$77*40,$77*40,$77*40
  321.     dc.w $77*40,$76*40,$76*40,$75*40,$73*40,$72*40,$71*40,$6F*40,$6D*40,$6B*40
  322.     dc.w $69*40,$67*40,$64*40,$61*40,$5F*40,$5C*40,$59*40,$56*40,$53*40,$50*40
  323.     dc.w $4C*40,$49*40,$46*40,$42*40,$3F*40,$3C*40,$38*40,$35*40,$31*40,$2E*40
  324.     dc.w $2B*40,$27*40,$24*40,$21*40,$1E*40,$1B*40,$18*40,$16*40,$13*40,$10*40
  325.     dc.w $E*40,$C*40,$A*40,$8*40,$6*40,$5*40,$4*40,$2*40,$1*40,$1*40
  326.     dc.w $0*40,$0*40,$0*40,$0*40,$0*40,$0*40,$1*40,$1*40,$2*40,$4*40
  327.     dc.w $5*40,$6*40,$8*40,$A*40,$C*40,$E*40,$10*40,$13*40,$16*40,$18*40
  328.     dc.w $1B*40,$1E*40,$21*40,$24*40,$27*40,$2B*40,$2E*40,$31*40,$35*40
  329.     dc.w $38*40
  330.     Dcb.w    10,$ffff
  331.      EVEN
  332.      
  333.  
  334. ; ** CHARACTER DECODER ROUTINE **
  335.  
  336. text:
  337.     move.l    acurent,a2                Get message
  338.     clr.l    d1                        
  339.     move.b    (a2)+,d1                Update it
  340.     move.b    d1,letter                Store in offset
  341.     cmp.b    #255,d1                    Check for end of message
  342.     beq.w    rst_text                If equal, then reset
  343.     cmp.b    #254,d1
  344.     beq        stop
  345.     sub.l    #32,d1                    Subract 32 (ie space)
  346.     asl        d1                        Times by 2 
  347.     move.l    a2,acurent                Update acurent
  348.     CMP.B    #"4",letter                Is letter "K" or larger
  349.     BPL.s    add_more                If larger then add on
  350.     rts                                Return
  351. add_more:
  352.     CMP.B    #"H",letter                Is letter "U" or larger
  353.     BPL.S    add_more2                If larger then add on
  354.     add.l    #40*15,d1                Get next line down (KLMNOPQRST)
  355.     rts
  356. add_more2:                    
  357.     add.l    #40*30,d1                Get next line down (UVWXYZ0123)
  358.     rts
  359. rst_text:
  360.     move.l    #0,d1
  361.     move.l    #message,d2                Get begining of text
  362.     move.l    d2,acurent                Reset to begining
  363.     rts                                Return
  364. stop:
  365.     move.l    #0,d1
  366.     add.l    #1,acurent
  367.     move.l    #150,stopper
  368.     rts
  369.  
  370. message:
  371.  
  372. ; 254=STOP,255=END.
  373.  
  374.     DC.B    " HI RAY    THIS IS A 2 PIXEL SINE SCROLL (HONESTLY!!)"
  375.     DC.B    "  CHECK OUT THE SINETABLE IN THE SOURCE AND SEE IF YOU CAN GET A BETTER AND BIGGER ONE TO GET FULL SCREEN"
  376.     DC.B    "  ALSO SEE IF KODAK CAN MAKE THIS RUN ANY FASTER COS ITS ABIT SLOOOOW"
  377.     DC.B    "  WRITE SOON....      PS. I'LL SEE YA ALL IN BLACKPOOL ON SATURDAY !!!!!"
  378.     DC.B    "   WRAP           ",255
  379.     EVEN
  380.             
  381.  
  382. ;                **********************************************
  383. ;                ** THE MUZAX PLAY ROUTINE FOR NOISE TRACKER ** 
  384. ;                  ******************************************
  385.  
  386.  
  387. MUZAX:
  388.  
  389.     jsr    Cryptic_init
  390.  
  391. end:    rts
  392. Cryptic_init:
  393.     lea    Cryptic_data,a0
  394.     add.l    #$03b8,a0
  395.     moveq    #$7f,d0
  396.     moveq    #0,d1
  397. Cryptic_init1:
  398.     move.l    d1,d2
  399.     subq.w    #1,d0
  400. Cryptic_init2:
  401.     move.b    (a0)+,d1
  402.     cmp.b    d2,d1
  403.     bgt.s    Cryptic_init1
  404.     dbf        d0,Cryptic_init2
  405.     addq.b    #1,d2
  406. Cryptic_init3:
  407.     lea        Cryptic_data,a0
  408.     lea        Cryptic_sample1(pc),a1
  409.     asl.l    #8,d2
  410.     asl.l    #2,d2
  411.     add.l    #$438,d2
  412.     add.l    a0,d2
  413.     moveq    #$1e,d0
  414. Cryptic_init4:
  415.     move.l    d2,(a1)+
  416.     moveq    #0,d1
  417.     move.w    42(a0),d1
  418.     asl.l    #1,d1
  419.     add.l    d1,d2
  420.     add.l    #$1e,a0
  421.     dbf        d0,Cryptic_init4
  422.     lea        Cryptic_sample1(PC),a0
  423.     moveq    #0,d0
  424. Cryptic_clear:
  425.     move.l    (a0,d0.w),a1
  426.     clr.l    (a1)
  427.     addq.w    #4,d0
  428.     cmp.w    #$7c,d0
  429.     bne.s    Cryptic_clear
  430.     clr.w    $dff0a8
  431.     clr.w    $dff0b8
  432.     clr.w    $dff0c8
  433.     clr.w    $dff0d8
  434.     clr.l    Cryptic_partnrplay
  435.     clr.l    Cryptic_partnote
  436.     clr.l    Cryptic_partpoint
  437.     move.b    Cryptic_data+$3b6,Cryptic_maxpart+1
  438.     rts
  439.     rts
  440. Cryptic_music:
  441.     addq.w    #1,Cryptic_counter
  442. Cryptic_cool:
  443.     cmp.w    #6,Cryptic_counter
  444.     bne.s    Cryptic_notsix
  445.     clr.w    Cryptic_counter
  446.     bra        Cryptic_rout2
  447. Cryptic_notsix:
  448.     lea        Cryptic_aud1temp(PC),a6
  449.     tst.b    3(a6)
  450.     beq.s    Cryptic_arp1
  451.     lea        $dff0a0,a5        
  452.     bsr.s    Cryptic_arprout
  453. Cryptic_arp1:
  454.     lea    Cryptic_aud2temp(PC),a6
  455.     tst.b    3(a6)
  456.     beq.s    Cryptic_arp2
  457.     lea        $dff0b0,a5
  458.     bsr.s    Cryptic_arprout
  459. Cryptic_arp2:
  460.     lea        Cryptic_aud3temp(PC),a6
  461.     tst.b    3(a6)
  462.     beq.s    Cryptic_arp3
  463.     lea        $dff0c0,a5
  464.     bsr.s    Cryptic_arprout
  465. Cryptic_arp3:
  466.     lea        Cryptic_aud4temp(PC),a6
  467.     tst.b    3(a6)
  468.     beq.s    Cryptic_arp4
  469.     lea        $dff0d0,a5
  470.     bra.s    Cryptic_arprout
  471. Cryptic_arp4:
  472.     rts
  473. Cryptic_arprout:
  474.     move.b    2(a6),d0
  475.     and.b    #$0f,d0
  476.     tst.b    d0
  477.     beq        Cryptic_arpegrt
  478.     cmp.b    #$01,d0
  479.     beq.s    Cryptic_portup
  480.     cmp.b    #$02,d0
  481.     beq.s    Cryptic_portdwn
  482.     cmp.b    #$0a,d0
  483.     beq.s    Cryptic_volslide
  484.     rts
  485. Cryptic_portup:
  486.     moveq    #0,d0
  487.     move.b    3(a6),d0
  488.     sub.w    d0,22(a6)
  489.     cmp.w    #$71,22(a6)
  490.     bpl.s    Cryptic_ok1
  491.     move.w    #$71,22(a6)
  492. Cryptic_ok1:    
  493.     move.w    22(a6),6(a5)
  494.     rts
  495. Cryptic_portdwn:
  496.     moveq    #0,d0
  497.     move.b    3(a6),d0
  498.     add.w    d0,22(a6)
  499.     cmp.w    #$538,22(a6)
  500.     bmi.s    Cryptic_ok2
  501.     move.w    #$538,22(a6)
  502. Cryptic_ok2:    
  503.     move.w    22(a6),6(a5)
  504.     rts
  505. Cryptic_volslide:
  506.     moveq    #0,d0
  507.     move.b    3(a6),d0
  508.     lsr.b    #4,d0
  509.     tst.b    d0
  510.     beq.s    Cryptic_voldwn
  511.     add.w    d0,18(a6)
  512.     cmp.w    #64,18(a6)
  513.     bmi.s    Cryptic_ok3
  514.     move.w    #64,18(a6)
  515. Cryptic_ok3:    
  516.     move.w    18(a6),8(a5)
  517.     rts
  518. Cryptic_voldwn:
  519.     moveq    #0,d0
  520.     move.b    3(a6),d0
  521.     and.b    #$0f,d0
  522.     sub.w    d0,18(a6)
  523.     bpl.s    Cryptic_ok4
  524.     clr.w    18(a6)
  525. Cryptic_ok4:    
  526.     move.w    18(a6),8(a5)
  527.     rts
  528. Cryptic_arpegrt:
  529.     move.w    Cryptic_counter(PC),d0
  530.     cmp.w    #1,d0
  531.     beq.s    Cryptic_loop2
  532.     cmp.w    #2,d0
  533.     beq.s    Cryptic_loop3
  534.     cmp.w    #3,d0
  535.     beq.s    Cryptic_loop4
  536.     cmp.w    #4,d0
  537.     beq.s    Cryptic_loop2
  538.     cmp.w    #5,d0
  539.     beq.s    Cryptic_loop3
  540.     rts
  541. Cryptic_loop2:
  542.     moveq    #0,d0
  543.     move.b    3(a6),d0
  544.     lsr.b    #4,d0
  545.     bra.s    Cryptic_cont
  546. Cryptic_loop3:
  547.     moveq    #$00,d0
  548.     move.b    3(a6),d0
  549.     and.b    #$0f,d0
  550.     bra.s    Cryptic_cont
  551. Cryptic_loop4:
  552.     move.w    16(a6),d2
  553.     bra.s    Cryptic_endpart
  554. Cryptic_cont:
  555.     add.w    d0,d0
  556.     moveq    #0,d1
  557.     move.w    16(a6),d1
  558.     and.w    #$fff,d1
  559.     lea        Cryptic_arpeggio(PC),a0
  560. Cryptic_loop5:
  561.     move.w    (a0,d0),d2
  562.     cmp.w    (a0),d1
  563.     beq.s    Cryptic_endpart
  564.     addq.l    #2,a0
  565.     bra.s    Cryptic_loop5
  566. Cryptic_endpart:
  567.     move.w    d2,6(a5)
  568.     rts
  569. Cryptic_rout2:
  570.     lea        Cryptic_data,a0
  571.     move.l    a0,a3
  572.     add.l    #$0c,a3
  573.     move.l    a0,a2
  574.     add.l    #$3b8,a2
  575.     add.l    #$43c,a0
  576.     move.l    Cryptic_partnrplay(PC),d0
  577.     moveq    #0,d1
  578.     move.b    (a2,d0),d1
  579.     asl.l    #8,d1
  580.     asl.l    #2,d1
  581.     add.l    Cryptic_partnote(PC),d1
  582.     move.l    d1,Cryptic_partpoint
  583.     clr.w    Cryptic_dmacon
  584.     lea        $dff0a0,a5
  585.     lea        Cryptic_aud1temp(PC),a6
  586.     bsr        Cryptic_playit
  587.     lea        $dff0b0,a5
  588.     lea        Cryptic_aud2temp(PC),a6
  589.     bsr        Cryptic_playit
  590.     lea        $dff0c0,a5
  591.     lea        Cryptic_aud3temp(PC),a6
  592.     bsr        Cryptic_playit
  593.     lea        $dff0d0,a5
  594.     lea        Cryptic_aud4temp(PC),a6
  595.     bsr        Cryptic_playit
  596.     move.w    #$01f4,d0
  597. Cryptic_rls:    
  598.     dbf        d0,Cryptic_rls
  599.     move.w    #$8000,d0
  600.     or.w    Cryptic_dmacon,d0
  601.     move.w    d0,$dff096
  602.     lea        Cryptic_aud4temp(PC),a6
  603.     cmp.w    #1,14(a6)
  604.     bne.s    Cryptic_voice3
  605.     move.l    10(a6),$dff0d0
  606.     move.w    #1,$dff0d4
  607. Cryptic_voice3:
  608.     lea        Cryptic_aud3temp(PC),a6
  609.     cmp.w    #1,14(a6)
  610.     bne.s    Cryptic_voice2
  611.     move.w    #1,$dff0c4
  612. Cryptic_voice2:
  613.     lea        Cryptic_aud2temp(PC),a6
  614.     cmp.w    #1,14(a6)
  615.     bne.s    Cryptic_voice1
  616.     move.l    10(a6),$dff0b0
  617.     move.w    #1,$dff0b4
  618. Cryptic_voice1:
  619.     lea        Cryptic_aud1temp(PC),a6
  620.     cmp.w    #1,14(a6)
  621.     bne.s    Cryptic_voice0
  622.     move.l    10(a6),$dff0a0
  623.     move.w    #1,$dff0a4
  624. Cryptic_voice0:
  625.     move.l    Cryptic_partnote(PC),d0
  626.     add.l    #$10,d0
  627.     move.l    d0,Cryptic_partnote
  628.     cmp.l    #$400,d0
  629.     bne.s    Cryptic_stop
  630. Cryptic_higher:
  631.     clr.l    Cryptic_partnote
  632.     addq.l    #1,Cryptic_partnrplay
  633.     moveq    #0,d0
  634.     move.w    Cryptic_maxpart(PC),d0
  635.     move.l    Cryptic_partnrplay(PC),d1
  636.     cmp.l    d0,d1
  637.     bne.s    Cryptic_stop
  638.     clr.l    Cryptic_partnrplay
  639.     ;st    Pflag
  640. Cryptic_stop:
  641.     tst.w    Cryptic_status
  642.     beq.s    Cryptic_stop2
  643.     clr.w    Cryptic_status
  644.     bra.s    Cryptic_higher
  645. Cryptic_stop2:
  646.     rts
  647. Cryptic_playit:
  648.     move.l    (a0,d1.l),(a6)
  649.     addq.l    #4,d1
  650.     moveq    #0,d2
  651.     move.b    2(a6),d2
  652.     and.b    #$f0,d2
  653.     lsr.b    #4,d2
  654.     move.b    (a6),d0
  655.     and.b    #$f0,d0
  656.     or.b    d0,d2
  657.     tst.b    d2
  658.     beq.s    Cryptic_nosamplechange
  659.     moveq    #0,d3
  660.     lea    Cryptic_samples(PC),a1
  661.     move.l    d2,d4
  662.     asl.l    #2,d2
  663.     mulu    #$1e,d4
  664.     move.l    (a1,d2),4(a6)
  665.     move.w    (a3,d4.l),8(a6)
  666.     move.w    2(a3,d4.l),18(a6)
  667.     move.w    4(a3,d4.l),d3
  668.     tst.w    d3
  669.     beq.s    Cryptic_displace
  670.     move.l    4(a6),d2
  671.     add.l    d3,d2
  672.     move.l    d2,4(a6)
  673.     move.l    d2,10(a6)
  674.     move.w    6(a3,d4.l),8(a6)
  675.     move.w    6(a3,d4.l),14(a6)
  676.     move.w    18(a6),8(a5)
  677.     bra.s    Cryptic_nosamplechange
  678. Cryptic_displace:
  679.     move.l    4(a6),d2
  680.     add.l    d3,d2
  681.     move.l    d2,10(a6)
  682.     move.w    6(a3,d4.l),14(a6)
  683.     move.w    18(a6),8(a5)
  684. Cryptic_nosamplechange:
  685.     move.w    (a6),d0
  686.     and.w    #$fff,d0
  687.     tst.w    d0
  688.     beq.s    Cryptic_retrout
  689.     move.w    (a6),16(a6)
  690.     move.w    20(a6),$dff096
  691.     move.l    4(a6),(a5)
  692.     move.w    8(a6),4(a5)
  693.     move.w    (a6),d0
  694.     and.w    #$fff,d0
  695.     move.w    d0,6(a5)
  696.     move.w    20(a6),d0
  697.     or.w    d0,Cryptic_dmacon
  698. Cryptic_retrout:
  699.     tst.w    (a6)
  700.     beq.s    Cryptic_nonewper
  701.     move.w    (a6),22(a6)
  702. Cryptic_nonewper:
  703.     move.b    2(a6),d0
  704.     and.b    #$0f,d0
  705.     cmp.b    #$0b,d0
  706.     beq.s    Cryptic_posjmp
  707.     cmp.b    #$0c,d0
  708.     beq.s    Cryptic_setvol
  709.     cmp.b    #$0d,d0
  710.     beq.s    Cryptic_break
  711.     cmp.b    #$0e,d0
  712.     beq.s    Cryptic_setfil
  713.     cmp.b    #$0f,d0
  714.     beq.s    Cryptic_setspeed
  715.     rts
  716. Cryptic_posjmp:
  717.     not.w    Cryptic_status
  718.     moveq    #0,d0
  719.     move.b    3(a6),d0
  720.     subq.b    #1,d0
  721.     move.l    d0,Cryptic_partnrplay
  722.     rts
  723. Cryptic_setvol:
  724.     move.b    3(a6),8(a5)
  725.     rts
  726. Cryptic_break:
  727.     not.w    Cryptic_status
  728.     rts
  729. Cryptic_setfil:
  730.     moveq    #0,d0
  731.     move.b    3(a6),d0
  732.     and.b    #1,d0
  733.     rol.b    #1,d0
  734.     and.b    #$fd,$bfe001
  735.     or.b    d0,$bfe001
  736.     rts
  737. Cryptic_setspeed:
  738.     move.b    3(a6),d0
  739.     and.b    #$0f,d0
  740.     beq.s    Cryptic_back
  741.     clr.w    Cryptic_counter
  742.     move.b    d0,Cryptic_cool+3
  743. Cryptic_back:    rts
  744. Cryptic_aud1temp:
  745.     dcb.w    10,0
  746.     dc.w    1
  747.     dcb.w    2,0
  748. Cryptic_aud2temp:
  749.     dcb.w    10,0
  750.     dc.w    2
  751.     dcb.w    2,0
  752. Cryptic_aud3temp:
  753.     dcb.w    10,0
  754.     dc.w    4
  755.     dcb.w    2,0
  756. Cryptic_aud4temp:
  757.     dcb.w    10,0
  758.     dc.w    8
  759.     dcb.w    2,0
  760. Cryptic_partnote:    dc.l    0
  761. Cryptic_partnrplay:    dc.l    0
  762. Cryptic_counter:    dc.w    0
  763. Cryptic_partpoint:    dc.l    0
  764. Cryptic_samples:    dc.l    0
  765. Cryptic_sample1:    dcb.l    31,0
  766. Cryptic_maxpart:    dc.w    0
  767. Cryptic_dmacon:    dc.w    0
  768. Cryptic_status:    dc.w    0
  769. Cryptic_arpeggio:
  770.     dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
  771.     dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
  772.     dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
  773.     dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
  774.     dc.w $008f,$0087,$007f,$0078,$0071,$0000,$0000,$0000
  775.  
  776.  
  777. ; ** THE COPPERLIST **
  778.  
  779. OURCOPPER:
  780. sp0lo:    dc.w    spr0ptl,$0000
  781. sp0hi:    dc.w    spr0pth,$0000
  782.         dc.w    bpl1mod,0,bpl2mod,0
  783.         dc.w    diwstrt,$2c81+16,diwstop,$2cc1
  784.         dc.w    bplcon0,$1200,bplcon1,$0000
  785.         dc.w    ddfstrt,$38,ddfstop,$d0
  786. *        dc.w    color00,$000,color01,$094
  787.         dc.w    color16,$aaa,color17,$aaa,color18,$aaa
  788.         dc.w    color19,$aaa,color20,$aaa
  789. bp1lo:    dc.w    bpl1ptl,$0000
  790. bp1hi:    dc.w    bpl1pth,$0000
  791.         wait    $2c09,$fffe
  792.         dc.w    color01,$f00
  793.         wait    $2e09,$fffe
  794.         dc.w    color01,$f11
  795.         wait    $3009,$fffe
  796.         dc.w    color01,$f00
  797.         wait    $3209,$fffe
  798.         dc.w    color01,$f11
  799.         wait    $3409,$fffe
  800.         dc.w    color01,$f22
  801.         wait    $3609,$fffe
  802.         dc.w    color01,$f33
  803.         wait    $389,$fffe
  804.         dc.w    color01,$f44
  805.         wait    $3a09,$fffe
  806.         dc.w    color01,$f55
  807.         wait    $3c09,$fffe
  808.         dc.w    color01,$f66
  809.         wait    $3e09,$fffe
  810.         dc.w    color01,$f77
  811.         wait    $4009,$fffe
  812.         dc.w    color01,$f88
  813.         wait    $4209,$fffe
  814.         dc.w    color01,$f99
  815.         wait    $4409,$fffe
  816.         dc.w    color01,$faa
  817.         wait    $4609,$fffe
  818.         dc.w    color01,$fbb
  819.         wait    $4809,$fffe
  820.         dc.w    color01,$fcc
  821.         wait    $4a09,$fffe
  822.         dc.w    color01,$fdd
  823.         wait    $4c09,$fffe
  824.         dc.w    color01,$fee
  825.         wait    $4e09,$fffe
  826.         dc.w    color01,$fff
  827.         wait    $5109,$fffe
  828.         dc.w    color01,$eef
  829.         wait    $5309,$fffe
  830.         dc.w    color01,$ddf
  831.         wait    $5509,$fffe
  832.         dc.w    color01,$ccf
  833.         wait    $5709,$fffe
  834.         dc.w    color01,$bbf
  835.         wait    $5909,$fffe
  836.         dc.w    color01,$aaf
  837.         wait    $5b09,$fffe
  838.         dc.w    color01,$99f
  839.         wait    $5d09,$fffe
  840.         dc.w    color01,$88f
  841.         wait    $5f09,$fffe
  842.         dc.w    color01,$77f
  843.         wait    $6109,$fffe
  844.         dc.w    color01,$66f
  845.         wait    $6309,$fffe
  846.         dc.w    color01,$55f
  847.         wait    $6509,$fffe
  848.         dc.w    color01,$44f
  849.         wait    $6709,$fffe
  850.         dc.w    color01,$33f
  851.         wait    $6909,$fffe
  852.         dc.w    color01,$22f
  853.         wait    $6a09,$fffe
  854.         dc.w    color01,$11f
  855.         wait    $6c09,$fffe
  856.         dc.w    color01,$00f
  857.         wait    $6e09,$fffe
  858.         dc.w    color01,$11f
  859.         wait    $7109,$fffe
  860.         dc.w    color01,$22f
  861.         wait    $7309,$fffe
  862.         dc.w    color01,$33f
  863.         wait    $7509,$fffe
  864.         dc.w    color01,$44f
  865.         wait    $7709,$fffe
  866.         dc.w    color01,$55f
  867.         wait    $7909,$fffe
  868.         dc.w    color01,$66f
  869.         wait    $7a09,$fffe
  870.         dc.w    color01,$77f
  871.         wait    $7c09,$fffe
  872.         dc.w    color01,$88f
  873.         wait    $7e09,$fffe
  874.         dc.w    color01,$99f
  875.         wait    $8009,$fffe
  876.         dc.w    color01,$aaf
  877.         wait    $8209,$fffe
  878.         dc.w    color01,$bbf
  879.         wait    $8409,$fffe
  880.         dc.w    color01,$ccf
  881.         wait    $8609,$fffe
  882.         dc.w    color01,$ddf
  883.         wait    $8809,$fffe
  884.         dc.w    color01,$eef
  885.         wait    $8a09,$fffe
  886.         dc.w    color01,$fff
  887.         wait    $8c09,$fffe
  888.         dc.w    color01,$fee
  889.         wait    $8e09,$fffe
  890.         dc.w    color01,$fdd
  891.         wait    $9109,$fffe
  892.         dc.w    color01,$fcc
  893.         wait    $9309,$fffe
  894.         dc.w    color01,$fbb
  895.         wait    $9509,$fffe
  896.         dc.w    color01,$faa
  897.         wait    $9709,$fffe
  898.         wait    $9909,$fffe
  899.         dc.w    color01,$f99
  900.         wait    $9b09,$fffe
  901.         dc.w    color01,$f88
  902.         wait    $9d09,$fffe
  903.         dc.w    color01,$f77
  904.         wait    $9f09,$fffe
  905.         dc.w    color01,$f66
  906.         end_copper
  907.         
  908.  
  909. ;LOCAL CONSTANTS
  910.  
  911. WBCOPPER:        DC.L    0
  912. GFXLIB:            DC.B     "graphics.library",0
  913. GFXBASE:        DC.L    0
  914. systemints:        dc.l    0
  915. scroll_offset:    dc.l    0
  916. screenx:        dc.l    picture
  917. letter:            dc.b    0
  918. acurent:        dc.l    message
  919. val:            dc.l    0
  920. lo_amplitude:    dc.l    2                        ; PISS AROUND WITH THESE
  921. hi_amplitude:    dc.l    4                        ; PISS AROUND WITH THESE
  922. Tango            Dc.l    0
  923. sin_screen:        Dc.l    SinePlane
  924. stopper:        dc.l    0
  925.  
  926.  
  927. ;BINARY FILES TO BE INCLUDED
  928.     EVEN
  929. picture    
  930.     dcb.b    10240,0
  931. SinePlane
  932.     dcb.b    10240,0
  933.     dcb.b    10240,0
  934. font
  935.     incbin    df1:neatfont.bin
  936. sprite:
  937.     include    df1:sprite.list
  938. cryptic_data:
  939.     incbin    "df0:mod.the year is 2025"
  940.     even
  941.     
  942.  
  943.  
  944.  
  945.  
  946.  
  947.     
  948.     
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.     
  957.     
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.     
  970.     
  971.